/*****************************************************************************
* | File      	:   LCD_1in3_test.c
* | Author      :   Waveshare team
* | Function    :   1.3inch LCD  test demo
* | Info        :
*----------------
* |	This version:   V1.0
* | Date        :   2021-08-20
* | Info        :
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to  whom the Software is
# furished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
******************************************************************************/
#include "LCD_Driver.h"
#include "LCD_1in3.h"



void LCD_draw_point(int32_t x, int32_t y, uint16_t color)
{
    //Paint_DrawPoint(x,y, *color, DOT_PIXEL_1X1,  DOT_FILL_RIGHTUP);
    LCD_1IN3_DisplayPoint(x,y, color);
    //Paint_SetPixel(x/2,y, *color);
    
}

void LCD_display_window(int32_t x1, int32_t y1, int32_t x2, int32_t y2, uint16_t* image)
{
    
    LCD_1IN3_DisplayWindows( x1,  y1,  x2, y2, image);
}

int LCD_init(void)
{

    sleep_ms(100);
    //printf("LCD_1in3_test Demo\r\n");
    if(DEV_Module_Init()!=0){
        return -1;
    }
    DEV_SET_PWM(50);
    /* LCD Init */
   // printf("1.3inch LCD demo...\r\n");
    LCD_1IN3_Init(HORIZONTAL);
    //LCD_1IN3_Clear(BLUE);
    
    //LCD_SetBacklight(1023);
    
    return 0;
}


